package dao;

import domain.Traveller;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TravellerDao {
    @Select("SELECT \n" +
            "  * \n" +
            "FROM\n" +
            "  traveller \n" +
            "  WHERE id IN \n" +
            "  (SELECT \n" +
            "    travellerId \n" +
            "  FROM\n" +
            "    orders_traveller \n" +
            "  WHERE  ordersId =  #{orderId})")
    List<Traveller> findByOrderId(String orderId);
}
